From: Tor-björn Claesson Date: Tue, 21 Sep 2010 09:36:24 +0000 (+0200) Subject: Add basic error handling to search system. X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~9714 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4571a0ea0d68d9cfdbcd61fdff2b094954983382;p=gnome-shell.git Add basic error handling to search system. If a search provider misbehaves, the search system fails to return any results from any providers. Work around this. https://bugzilla.gnome.org/show_bug.cgi?id=627950 --- diff --git a/js/ui/search.js b/js/ui/search.js index 2624f09aa..f2a991524 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -258,16 +258,24 @@ SearchSystem.prototype = { if (isSubSearch) { for (let i = 0; i < this._previousResults.length; i++) { let [provider, previousResults] = this._previousResults[i]; - let providerResults = provider.getSubsearchResultSet(previousResults, terms); - if (providerResults.length > 0) - results.push([provider, providerResults]); + try { + let providerResults = provider.getSubsearchResultSet(previousResults, terms); + if (providerResults.length > 0) + results.push([provider, providerResults]); + } catch (error) { + global.log ('A ' + error.name + ' has occured in ' + provider.title + ': ' + error.message); + } } } else { for (let i = 0; i < this._providers.length; i++) { let provider = this._providers[i]; - let providerResults = provider.getInitialResultSet(terms); - if (providerResults.length > 0) - results.push([provider, providerResults]); + try { + let providerResults = provider.getInitialResultSet(terms); + if (providerResults.length > 0) + results.push([provider, providerResults]); + } catch (error) { + global.log ('A ' + error.name + ' has occured in ' + provider.title + ': ' + error.message); + } } }